package com.example.ssmxuankeback.dto;

import com.example.ssmxuankeback.entity.Course;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import lombok.NoArgsConstructor;

import java.util.List;

//dto没有考试类型和当前选课人数
@Data
@Schema(name = "CourseDTO", description = "课程数据传输对象")
public class CourseDTO {
    @NotNull(message = "课程编号不能为空")
    @Schema(description = "课程id")
    private Long courseId;

    @NotBlank(message = "课程名称不能为空")
    @Size(min = 2, max = 50, message = "课程名称长度需在2-50字符之间")
    @Schema(description = "课程名称")
    private String courseName;

    @NotEmpty(message = "学分不能为空")
    @Min(value = 1, message = "学分最小为1")
    @Max(value = 6, message = "学分最大为6")
    @Schema(description = "学分")
    private Integer credit;

    @NotEmpty(message = "教师编号不能为空")
    @Schema(description = "教师id")
    private Long teacherId;

    @NotEmpty(message = "最大选课人数不能为空")
    @Positive(message = "最大选课人数必须大于0")
    @Schema(description = "最大选课人数")
    private Integer maxSeats;
}